﻿using Dotnet.TopApi;
using Dotnet.TopApi.Request;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dotnet.Sui
{
    /// <summary>
    /// https://www.sui.com/tally/new.rmi  public interface ITopRequest<T> where T : TopResponse
    /// </summary>
    public class TallyNewRmiRequest : SuiRequest, ITopRequest<TallyNewRmiResponse> //ITopRequest<TallyNewRmiResponse>
    {
        private string _opt = "list2";
        private string _beginDate = "";//时间
        private string _endDate = "";//时间
        private string _cids = "0";
        private string _bids = "0";
        private string _sids = "0";
        private string _pids = "0";
        private string _memids = "0";
        private string _order = "";
        private string _isDesc = "0";
        private string _page = "1";
        private string _note = "";
        private string _mids = "0";
        #region 公有属性
        public string Opt { get=>_opt; set=>_opt=value; }
        public string BeginDate { get=>_beginDate; set=>_beginDate=value; }
        public string EndDate { get=>_endDate; set=>_endDate=value; }
        public string Cids { get=>_cids; set=>_cids=value; }
        public string Bids { get=>_bids; set=>_bids=value; }
        public string Sids { get=>_sids; set=>_sids=value; }
        public string Pids { get=>_pids; set=>_pids=value; }
        public string Memids { get=> _memids; set=> _memids = value; }
        public string Order { get=>_order; set=>_order=value; }
        public string IsDesc { get=>_isDesc; set=>_isDesc=value; }
        public string Page { get=>_page; set=>_page=value; }
        public string Note { get=>_note; set=>_note=value; }
        public string Mids { get=>_mids; set=>_mids=value; }
        #endregion

        public string GetApiName()
        {
            return "tally/new.rmi";
        }
        public IDictionary<string, string> GetParameters()
        {
            TopDictionary dict = base.GetParameters1() as TopDictionary;
            dict.AddHeadersContentType("application/x-www-form-urlencoded;charset=UTF-8");
            dict.Add("opt", _opt);
            dict.Add("beginDate", _beginDate);
            dict.Add("endDate", _endDate);
            dict.Add("cids", _cids);
            dict.Add("bids", _bids);
            dict.Add("sids", _sids);
            dict.Add("pids", _pids);
            dict.Add("memids", _memids);
            dict.Add("order", _order);
            dict.Add("isDesc", _isDesc);
            dict.Add("page", _page);
            dict.Add("note", _note);
            dict.Add("mids", _mids);
            return dict;
        }

        public virtual void Validate()
        {
            //throw new NotImplementedException();
        }
    }

    public class TallyNewRmiResponse : SuiRespose
    {
        public List<Groups> _groups = new List<Groups>();
        /// <summary>
        /// 
        /// </summary>
        public decimal income { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string beginDate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string symbol { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int pageCount { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string endDate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int pageNo { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public decimal payout { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<Groups> groups { get=>_groups; set=>_groups=value; }
    }
    public class Groups
    {
        private List<List> _list = new List<List>();
        /// <summary>
        /// 
        /// </summary>
        public double income { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public double payout { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<List> list { get=>_list; set=>_list=value; }
    }
    public class Date
    {
        /// <summary>
        /// 
        /// </summary>
        public int date { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int day { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int hours { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int minutes { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int month { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int seconds { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string time { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int timezoneOffset { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int year { get; set; }
    }

    public class List
    {
        /// <summary>
        /// 
        /// </summary>
        public decimal account { get; set; }
        /// <summary>
        /// 211支付宝
        /// </summary>
        public string buyerAcount { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string buyerAcountId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string categoryIcon { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string categoryId { get; set; }
        /// <summary>
        /// 其他消费
        /// </summary>
        public string categoryName { get; set; }
        /// <summary>
        /// 自支:20240423234734750:收钱码收款 :2024040122001485171423184891
        /// </summary>
        public string content { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public decimal currencyAmount { get; set; }

        public Date _date = new Date();
        public Date date { get=>_date; set=>_date=value; }
        /// <summary>
        /// 
        /// </summary>
        public string imgId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public decimal itemAmount { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string memberId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string memberName { get; set; }
        /// <summary>
        /// 自支:20240423234734750:收钱码收款 :2024040122001485171423184891
        /// </summary>
        public string memo { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string projectId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string projectName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string relation { get; set; }
        /// <summary>
        /// 账单ID
        /// </summary>
        public string sId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string sellerAcount { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string sellerAcountId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string tranId { get; set; }
        /// <summary>
        /// 支出
        /// </summary>
        public string tranName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string tranType { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string transferStoreId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string url { get; set; }
    }


}
